<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="./js/vue.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
    <title>Document</title>
    <style>
        #app {
            width: 500px;
            height: 400px;
            margin: 10px auto;
            overflow: hidden;
        }

        #nav {
            width: 500px;
            height: 50px;
            display: flex;
            justify-content: space-between;
        }

        .nav_div {
            width: 150px;
            height: 50px;
            line-height: 50px;
            text-align: center;
            border-radius: 10%;
            background-color: pink;
            cursor: pointer;
        }

        #main {
            position: relative;
        }

        .nav_div:hover {
            background-color: aqua;
        }

        .main_div {
            width: 500px;
            height: 350px;
            background-color: orange;
            border: 1px solid;
            position: absolute;
            left: 0px;
            top: opx;
        }

        .active {
            background-color: skyblue;
            animation: tada 1s;
        }

        .op-enter-active {
            animation: bounceInRight 1s;
        }

        .op-leave-active {
            animation: backOutLeft 1s;
        }
    </style>
</head>

<body>
    <div id="app">
        <div id="nav">
            <div class="nav_div" @click="show=0" :class="show==0?'active':''">页面1</div>
            <div class="nav_div" :class="show==1?'active':''" @click="show=1">页面2</div>
            <div class="nav_div" :class="show==2?'active':''" @click="show=2">页面3</div>
        </div>
        <div id="main">
            <transition-group name="op" mode="out-in">
                <div class="main_div" :key="0" v-show="show==0">1</div>
                <div class="main_div" :key="1" v-show="show==1">2</div>
                <div class="main_div" :key="2" v-show="show==2">3</div>
            </transition-group>
        </div>
    </div>
</body>
<script>
    const vm = new Vue({
        el: "#app",
        data: {
            show: "1"
        }
    })
</script>

</html>